package com.gkym.es.entity;

import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * [ demo测试类 ]
 *
 * @author Love丶TG
 * @version 1.0.0
 * @create 2020 年 01 月 17 日 10:43
 */
//@Data
@Getter @Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "demo", type = "docs", shards = 1, replicas = 0)
public class Demo {
    @Id
    private Long id;

//    @Field(type = FieldType.Text, analyzer = "ik_max_word")
//    @Field(index = true,type = FieldType.Text,analyzer="ik_max_word",searchAnalyzer="ik_max_word")
    @Field(type = FieldType.Text)
    private String name; // 名称

    @Field(type = FieldType.Keyword)
    private String category;// 类型

    @Field(type = FieldType.Integer)
    private Integer amount; // 数量

    @Field(index = false, type = FieldType.Keyword)
    private String url; // 照片
}
